# -*- coding:utf-8 -*-
# -------------------------------------------------------------------------------
# Description:  
# Reference:
# Author: 安智军
# Date:   2021/12/10
# -------------------------------------------------------------------------------
from selenium.webdriver.common.by import By


class PurchaseReceiptOrderPageLoc:

    # 【进入仓库后重新选择仓库】
    # 1、点击切换仓库元素
    Switch_warehouse = By.XPATH, "/html/body/div[1]/div/div[2]/div[1]/div/div[3]/div[1]/div"
    # 2、点击选择仓库按钮
    click_choose_warehouse_btn = By.CSS_SELECTOR, "body > div.el-dialog__wrapper > div > div.el-dialog__body > form > div:nth-child(1) > div > div > div > div > div > input"
    # 3、选择仓库并点击 默认选择京东自动化仓库
    click_choose_warehouse = By.XPATH, "//span[contains(text(),'京东自动化仓库')]"
    # 4、点击进入仓库按钮
    Enter_warehouse_btn = By.CSS_SELECTOR, "body > div.el-dialog__wrapper > div > div.el-dialog__footer > span > button"

    # 【作业端菜单部分】
    # 1、菜单按钮 点击菜单按钮弹出菜单
    click_menu_btn = By.CSS_SELECTOR, "#app > div > div.main-container > div:nth-child(1) > div > div.hamburger-container"
    # 2、点击订单管理展开订单管理菜单 默认先进入订单管理菜单cd
    click_Order_management_menu = By.XPATH,"/html/body/div/div/div[1]/div[2]/div[1]/div/ul/div[4]/li/div/i[2]"
    # 3、点击采购入库订单
    click_Purchase_receipt_order_menu = By.XPATH,"/html/body/div[1]/div/div[1]/div[2]/div[1]/div/ul/div[4]/li/ul/div[1]/a/li"
    # 4、点击创建采购单按钮
    click_Purchase_receipt_order_btn = By.XPATH,"//span[contains(text(),'创建采购单')]"
    # 5、点击单据类型并选择采购入库
    click_Document_type_ele = By.XPATH,"/html/body/div/div/div[2]/section/div/div[1]/div/div/form/div[1]/div[1]/div/div/div/div[1]/input"
    click_choose_Document_type= By.XPATH, "/html/body/div[2]/div[1]/div[1]/ul/li[1]"
    # 6、点击并选择货主名称
    click_Owner_name = By.XPATH, "//label[contains(text(),'货主名称')]/parent::div/div/div/div/input"
    click_choose_Owner_name= By.XPATH, "//span[contains(text(),'UI自动化')]"
    # 7、点击并选择供应商名称
    click_Supplier_name = By.XPATH, "/html/body/div[1]/div/div[2]/section/div/div[1]/div/div/form/div[1]/div[3]/div/div/div/div/input"
    click_choose_Supplier_name= By.XPATH, "//span[contains(text(),'UI供应商')]"
    # 8、点击并输入外部单号（外部单号来源于json文件）
    ExternalPoNo_ele = By.XPATH, "//form[@id='form']/div[2]/div[1]/div/div/div/input"
    # 9、输入采购入库单号的备注(备注信息来源于json文件)
    Purchase_order_remark_ele = By.XPATH, "//label[contains(text(),'备注')]/parent::div/div/div/input"
    # 10、点击添加商品
    click_addgoods_btn= By.XPATH, "//span[contains(text(),'添加商品')]"
    # 11、点击商品名称并选择商品
    click_goodsname = By.XPATH, "/html/body/div[6]/div/div[2]/div/form/div[1]/div/div/div/div[1]/input"
    click_choose_goodsname= By.XPATH, "//span[contains(text(),'韩国泡面/')]"
    # 12、输入商品数量(商品数量来源于json文件)
    input_goodsnum= By.XPATH, "/html/body/div[6]/div/div[2]/div/form/div[4]/div/div/div/div/input"
    # 13、点击“保存并添加下一条按钮”
    click_save_goods = By.XPATH, "//span[contains(text(),'保存并添加')]"
    # 14、点击关闭按钮
    click_close_ele = By.XPATH,"/html/body/div[6]/div/div[1]/button/i"
    # 15、点击保存并创建采购单
    click_and_create_Purchase_order = By.XPATH, "//span[contains(text(),'保存')]"

    ###################################  对创建的成功的数据进行校验  断言开始  ################################
    # 点击重置
    Reset_btn= By.XPATH, "//span[contains(text(),'重置')]"
    # 点击搜索按钮刷新列表数据
    srarch_btn = By.XPATH,"//span[contains(text(),'搜索')]/parent::button"
    # 获取最新创建的采购入库订单的采购单号（每次拿到的都是最新的采购单号）
    Purchase_order_No= By.XPATH, "/html/body/div[1]/div/div[2]/section/div/div[2]/div[2]/div/div/div[2]/div[1]/div[2]/table/tbody/tr[1]/td[3]/div/span"
    # 点击输入采购单号
    input_Purchase_order_No= By.XPATH, "/html/body/div/div/div[2]/section/div/div[1]/form/div/div[5]/div/div/div/input"
    # 输入采购单号点击搜索
    Purchase_order_No_srarch_btn = By.XPATH, "//span[contains(text(),'搜索')]/parent::button"
    # 断言外部采购单号
    assert_External_Po_No= By.XPATH, "//span[contains(text(),'UI自动化外部采购单')]"
    # 断言输入的备注内容备注
    assert_remark = By.XPATH, "/html/body/div[1]/div/div[2]/section/div/div[2]/div[2]/div/div/div[2]/div[1]/div[2]/table/tbody/tr/td[23]/div/span"
    # 断言商品数量
    assert_goods_num= By.XPATH, "/html/body/div[1]/div/div[2]/section/div/div[2]/div[2]/div/div/div[2]/div[1]/div[2]/table/tbody/tr/td[19]/div"
    # 断言其他字段不为空
    # 断言sku数量不为空
    assert_sku_num= By.XPATH, "/html/body/div[1]/div/div[2]/section/div/div[2]/div[2]/div/div/div[2]/div[1]/div[2]/table/tbody/tr/td[20]/div/span"
    # 断言仓库名称不为空
    assert_Warehouse_name = By.XPATH, "/html/body/div[1]/div/div[2]/section/div/div[2]/div[2]/div/div/div[2]/div[1]/div[2]/table/tbody/tr/td[18]/div/span"
    # 断言其他的字段是否为空 一致 有空在写
    ###########################################################  断言结束  #######################################

    # 勾选选择第一条数据
    Selection_box_btn= By.XPATH, "/html/body/div[1]/div/div[2]/section/div/div[2]/div[2]/div/div/div[2]/div[2]/div[1]/div[2]/table/tbody/tr[1]/td[1]/div/span/span[2]"
    # 点击一键审核
    One_click_audit= By.XPATH, "//span[contains(text(),'一键审核')]"
    # 一键审核-确定
    Audit_confirm = By.XPATH, "//span[contains(text(),'确定')]/parent::button"

    # 【入库管理-标准验收】
    # 点击入库管理菜单按钮
    click_Warehousing_management_menu = By.XPATH, "	//span[contains(text(),'入库管理')]"
    # 点击收货入库菜单
    click_Receipt_and_warehousing_menu= By.XPATH, "//span[contains(text(),'收货入库')]"
    # 点击重置按钮
    The_goods_warehouse_reset = By.XPATH, "/html/body/div[1]/div/div[2]/section/div/div[1]/form/div/div[12]/button[2]"
    # 点击搜索
    The_goods_warehouse_search = By.XPATH, "//span[contains(text(),'搜索')]"
    # 在订单单号输入框输入采购单号
    input_The_rder_number = By.XPATH, "/html/body/div[1]/div/div[2]/section/div/div[1]/form/div/div[7]/div/div/div/input"
    # 点击搜索 同上
    # 点击验收按钮 进入标准验收页面
    click_acceptance = By.XPATH, "/html/body/div[1]/div/div[2]/section/div/div[2]/div[2]/div/div/div[2]/div[2]/div[2]/div[2]/table/tbody/tr/td/div/div/button/span/i"
    # 关闭标准验收页面
    close_acceptance_btn = By.XPATH, '//*[@id="tags-view-container"]/div/div[1]/div/span[3]/span'
    # 勾选商品
    click_tick_goods = By.XPATH, "/html/body/div[1]/div/div[2]/section/div/div[2]/div/div[1]/div[2]/div/div[2]/div[1]/div[2]/table/tbody/tr/td[1]/div/span/span[2]"
    # 点击本次验收(因为是全部数量所以会整单完验)
    click_this_acceptance = By.XPATH, "//span[contains(text(),'本次验收')]"

    # 点击重置搜索判断单据状态是否已完验 并获取入库单号
    # 点击重置
    # 点击搜索
    # 输入订单单号并点击搜索
    # 断言 该单据状态是否为已完验
    assert_is_Complet_acceptance = By.XPATH, "//span[contains(text(),'已完验')]"
    # 获取已完验的入库单号(用于在上架查询使用)
    Receipt_no= By.XPATH, "//div[@id='table']/div/div/div[2]/div[1]/div[2]/table/tbody/tr/td[3]/div/span"

    # 点击纸单上架
    click_Paper_sheet_shelves_menu= By.XPATH, "//span[contains(text(),'纸单上架')]"
    # 点击重置
    Paper_sheet_shelves_reset = By.XPATH, "//span[contains(text(),'重置')]"
    # 输入入库单号后点击搜索
    input_Receipt_no= By.XPATH, "/html/body/div[1]/div/div[2]/section/div/div[1]/form/div/div[5]/div/div/div/input"
    # 点击搜索该入库单号
    click_search_input_Receipt_no= By.XPATH, "//span[contains(text(),'搜索')]/parent::button"
    # 点击上架按钮
    click_shelves_btn = By.XPATH, "/html/body/div[1]/div/div[2]/section/div/div[2]/div[2]/div/div/div[2]/div[1]/div[2]/table/tbody/tr/td[14]/div/div/button[1]"
    # 输入实际上架库位
    input_Actual_shelf_position = By.XPATH, "//span[contains(text(),'UIJK01bm')]/parent::div/parent::td/parent::tr/td/div/span/div/input"
    # 获取应上架数量的值
    get_Should_be_on_num_value= By.XPATH, "/html/body/div[6]/div/div[2]/div[2]/div[2]/div[1]/div[2]/table/tbody/tr/td[10]/div"
    # 将获取应上架数量的值输入到实际上架数量的位置
    input_actual_should_be_on = By.XPATH, "//span[contains(text(),'UIJK01bm')]/parent::div/parent::td/parent::tr/td/div/span/div/div/input"
    # 点击上架确认
    click_shelves_confirm = By.XPATH, "//span[contains(text(),'上架确认')]"

    # 对上架成功后数据校验
    # 断言上架状态
    # assert_shelves_status = By.XPATH, "//span[contains(text(),'上架完成')]"
    assert_shelves_status = By.XPATH, "/html/body/div[1]/div/div[2]/section/div/div[2]/div[2]/div/div/div[2]/div[1]/div[2]/table/tbody/tr/td[10]/div/span"
    # 断言其他字段.....

    # 点击查看明细
    click_watch_detail = By.XPATH, "/html/body/div[1]/div/div[2]/section/div/div[2]/div[2]/div/div/div[2]/div[1]/div[2]/table/tbody/tr/td[14]/div/div/button[2]/span/i"
    # 断言查看明细中的其他内容
    #。。。。。。。。。。。先不写

    # 断言实际上架中的内容
    click_detail_close= By.XPATH, "//span[contains(text(),'关闭')]/parent::button"





    # = By.XPATH, ""
    # = By.XPATH, ""
    # = By.XPATH, ""


    #### 以下元素用于断言使用######



    # = By.XPATH, ""
    # = By.XPATH, ""
    # = By.XPATH, ""
    # = By.XPATH, ""




